aboutsummaryrefslogtreecommitdiffstats
path: root/code/frontend/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts
blob: 9e24736d211aab2cc551f1d5f92030dad97c0d49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import { is_guid } from "$utils/validators";
import { redirect } from "@sveltejs/kit";
import type { PageServerLoad } from "./$types";

export const load: PageServerLoad = async ({ params }) => {
    const resetRequestId = params.id ?? "";
    if (!is_guid(resetRequestId)) throw redirect(302, "/reset-password");
    return {
        resetRequestId,
    };
};